Skip to content

Add an 8 pt fallback for unusually dense callouts - #761

Closed
mikec-ai wants to merge 1 commit into
mainfrom
codex/dense-callout-8pt
Closed

Add an 8 pt fallback for unusually dense callouts#761
mikec-ai wants to merge 1 commit into
mainfrom
codex/dense-callout-8pt

Conversation

@mikec-ai

Copy link
Copy Markdown
Collaborator

What changed

  • Added an 8 pt font tier for first-section floating callouts with 150 or more combined words.
  • Preserved the existing 10 pt, 9.25 pt, and 8.5 pt tiers below that threshold.
  • Kept Have questions? in the combined count with Key facts and Key dates.
  • Moved the class selection into one template filter so the threshold boundaries can be tested directly.

Why

The CDC K01 fixture investigated in #757 contains 153 combined callout words. Builder already applies its smallest current tier, 8.5 pt, but the production preview can still move the callouts to the next page.

This adds a narrowly targeted fallback without shrinking every callout currently above 99 words or requiring per-NOFO CSS.

Closes #759.

Validation

  • All 1,486 tests pass.
  • Focused tests cover 79/80, 99/100, and 149/150 word boundaries.
  • A fixture-shaped test confirms that 6 + 23 + 124 words across three callouts activates the dense tier.
  • Black and isort checks pass.
  • The imported CDC fixture reports 153 combined words and receives both the existing tiny class and the new dense class.
  • Local CDC Default and ACF Light comparisons show the expected vertical reduction at 8 pt.

Dev verification needed before merge

Local browser PDF output is not authoritative because production uses DocRaptor and Prince. Please:

  1. Deploy this branch to dev.
  2. Import the CDC K01 fixture used in Spike: Investigate resilient sizing for Key facts and Key dates #757.
  3. Generate a watermarked Preview PDF in CDC Default.
  4. Confirm Key facts and Key dates remain on the Basic information page and are readable at 100 percent.
  5. Repeat with ACF Light.

If the callouts still move to the next page, leave the PR open so the threshold or layout treatment can be adjusted before merge.

@mikec-ai
mikec-ai requested a review from benbrasso July 23, 2026 14:41
@mikec-ai

Copy link
Copy Markdown
Collaborator Author

Local comparison

These screenshots use the exact 153-word CDC fixture. They were generated with local Chrome, so right-edge wrapping is not representative of the production Prince renderer. They show the comparative vertical reduction only.

CDC Default

Current 8.5 pt tier:

CDC Default at 8.5 pt

Proposed 8 pt tier:

CDC Default at 8 pt

ACF Light

Current 8.5 pt tier:

ACF Light at 8.5 pt

Proposed 8 pt tier:

ACF Light at 8 pt

The 8 pt tier materially shortens the Key dates box in both themes. The remaining acceptance check is the same fixture through the dev DocRaptor preview before merge.

Copy link
Copy Markdown
Collaborator Author

Dev DocRaptor validation

Tested the exact CDC K01 fixture on dev using commit f074e86.

  • CDC Portrait (Default): does not meet the acceptance criteria. Key facts renders on page 5, while Key dates moves to page 6. The text is readable at 100 percent and nothing is clipped, but the paired callouts do not remain together on the Basic information page.
  • ACF (Light): passes. Have questions, Key facts, and Key dates all remain together on page 5 and are readable at 100 percent.

Deployment run: https://github.com/HHS/simpler-grants-gov/actions/runs/30018361630

Because CDC Default still splits the callouts across physical pages, this PR should remain open for adjustment.

@benbrasso
benbrasso force-pushed the codex/dense-callout-8pt branch from f074e86 to 24fdb15 Compare July 27, 2026 14:26
@benbrasso

Copy link
Copy Markdown
Collaborator

@mikec-ai were we ready to review and merge this one in? I think it got stale for some reason.

@mikec-ai

Copy link
Copy Markdown
Collaborator Author

@benbrasso no - I need to circle back to this one. The solution that was tried didn't work for CDC.

@mikec-ai

Copy link
Copy Markdown
Collaborator Author

Closing without merge. Dev DocRaptor validation showed that the proposed 8 pt tier passed ACF Light but still split Key facts and Key dates across pages in CDC Default. Following product review, #759 is deferred because this case is expected to be exceptionally rare and can be handled with targeted support if it occurs.

@mikec-ai mikec-ai closed this Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an 8 pt fallback for unusually dense Key facts and Key dates

3 participants